package com.community.zhihuishequ.view.collect;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.widget.Button;
import android.widget.RelativeLayout;

import com.community.zhihuishequ.R;
import com.community.zhihuishequ.view.base.BaseActivity;

import org.greenrobot.eventbus.EventBus;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 信息采集（Ps：包括业主，租户，草稿）
 */
public class CollectManagerActivity extends BaseActivity {

    @BindView(R.id.toolBar)
    Toolbar toolBar;
    @BindView(R.id.appBarLayout)
    AppBarLayout appBarLayout;
    @BindView(R.id.rl_owner)
    RelativeLayout rlOwner;
    @BindView(R.id.rl_lessee)
    RelativeLayout rlLessee;
    @BindView(R.id.rl_draft)
    RelativeLayout rlDraft;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_collect_manager);
        unbinder = ButterKnife.bind(this);
        initActionBar(toolBar, true);
        toolBar.setNavigationIcon(R.drawable.ic_back);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId() == android.R.id.home) {
            finish();
        }
        return super.onOptionsItemSelected(item);
    }

    @OnClick(R.id.rl_owner)
    public void onRlOwnerClicked() {
        Intent intent = new Intent();
        intent.putExtra("type", 1);
        intent.setClass(this, CollectFragmentActivity.class);
        startActivity(intent);
    }

    @OnClick(R.id.rl_lessee)
    public void onRlLesseeClicked() {
        Intent intent = new Intent();
        intent.putExtra("type", 2);
        intent.setClass(this, CollectFragmentActivity.class);
        startActivity(intent);
    }

    @OnClick(R.id.rl_draft)
    public void onRlDraftClicked() {
        startActivity(new Intent(this, CollectDraftListActivity.class));
    }
}
